<?php

use Illuminate\Routing\Router;

Admin::routes();

Route::group([
    'prefix'     => config('admin.route.prefix'),
    'namespace'  => config('admin.route.namespace'), // 这里已经设置了namespace，后面直接写相对路径即可
    'middleware' => config('admin.route.middleware'),
    'as'         => config('admin.route.prefix') . '.',
], function (Router $router) {
    // 首页
    $router->get('/', 'HomeController@index')->name('home');

    // 个人信息
    $router->any('/userinfo', 'UserinfoController@detail')->name('userinfo_index');

    // 人员管理
    $router->resource('employee', EmployeeController::class);
    $router->resource('sequence', SequenceController::class);
    $router->resource('category', CategoryController::class);
    $router->resource('position', PositionController::class);
    $router->get('/sequence_select', 'SequenceController@sequenceSelect')->name('sequence_select');

    // 内容管理
    $router->resource('rotation', RotationController::class);
    $router->resource('newsflash', NewsflashController::class);
    $router->any('/center', 'CenterController@detail')->name('center_detail');
    $router->resource('timeline', TimelineController::class);
    $router->resource('memorabilia', MemorabiliaController::class);
    $router->resource('research', ResearchController::class);
    $router->resource('friendlink', FriendlinkController::class);
    $router->resource('partner', PartnerController::class);
    $router->any('/contact', 'ContactController@detail')->name('contact_detail');

    // 快速链接
    $router->resource('publication', PublicationController::class);
    $router->resource('sublink', SublinkController::class);

    // 学术新闻活动
    $router->resource('conference', ConferenceController::class);
    $router->resource('lectures', LecturesController::class);
    $router->resource('news', NewsController::class);
    $router->resource('events', EventsController::class);

    // 人才招聘
//    $router->resource('recruitment', RecruitmentController::class);
    $router->any('/recruitment', 'RecruitmentController@detail')->name('recruitment_detail');
    $router->any('/information', 'InformationController@detail')->name('information_detail');

    // froala文件管理
    $router->post('/upload_images', 'FileController@uploadImages')->name('froala_upload_images');
    $router->post('/upload_videos', 'FileController@uploadVideos')->name('froala_upload_videos');
    $router->post('/upload_files', 'FileController@uploadFiles')->name('froala_upload_files');
});
